﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TalksLog.Domain.Account.Entities;

namespace TalksLog.Infrastructure.EFRepository.EntityTypeConfigurations
{
    class AccountTypeConfiguration: EntityTypeConfiguration<Account>
    {
        public AccountTypeConfiguration()
        {
            Property(u => u.Id).HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.None);

            Property(u => u.Name).IsRequired()
                .HasMaxLength(50);           

            Property(u => u.Password).IsRequired()
                .HasMaxLength(50);

            Property(u => u.Gender).IsRequired();

            Property(u => u.Email).IsRequired()
                .HasMaxLength(50);

            Property(u => u.Address.City).HasMaxLength(20);
            Property(u => u.Address.District).HasMaxLength(20);
            Property(u => u.Address.Province).HasMaxLength(20);

            Property(u => u.Contacts.Email).HasMaxLength(50);
            Property(u => u.Contacts.QQ).HasMaxLength(15);
            Property(u => u.Contacts.WeChart).HasMaxLength(50);

            Property(u => u.ProfilePicture).HasMaxLength(100);
            Property(u => u.ThumbnailProfilePicture).HasMaxLength(100);
        }
    }
}
